package com.physique.tea.Service.Impl;

import com.physique.tea.Global.Result;
import com.physique.tea.Global.ResultList;
import com.physique.tea.Mapper.OrderMapper;
import com.physique.tea.Pojo.Order;
import com.physique.tea.Service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    @Override
    public Result getOrderByUsername(String username) {
        List<Order> orders = orderMapper.selectByUsername(username);
        return new Result(ResultList.SUCCESS.getCode(),
                ResultList.SUCCESS.getMessage(),
                orders);
    }
}
